const co=require('co-mysql')
const mysql = require('mysql');
const {dbConfig}=require('../config')
const pool = mysql.createPool(dbConfig);
//通过getConnection()方法进行数据库连接
pool.getConnection(function(err,connect){
    if(err){
        console.log(`mysql链接失败${err}`);
    }else{
        console.log(`mysql链接成功`);
    }
}); 
let db=co(pool);
module.exports=db;